﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class AccountDetail : System.Web.UI.Page
{
    BankServices.BankingServices sv = new BankServices.BankingServices();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            InitDetailInfo();
        }
    }

    private void InitDetailInfo()
    {
        if (!Session["AccountID"].Equals(""))
        {
            var accountDetail = sv.GetAccountDetail(int.Parse(Session["AccountID"].ToString()));
            lblFullName.Text = accountDetail.FullName;
            lblEmail.Text = accountDetail.Email;
            if (accountDetail.Active == 0)
            {
                lblStatus.Text = "Ngừng hoạt động";
            }
            else
            {
                lblStatus.Text = "Hoạt động";
            }
            lblUsername.Text = accountDetail.UserName;
            lblAccountID.Text = Session["AccountID"].ToString();
            lblAddress.Text = accountDetail.Address;
            lblBirthDay.Text = accountDetail.DateOfBirth.Date.ToString();
            lblDateCreated.Text = accountDetail.DateCreated.Date.ToString();
            lblPhone.Text = accountDetail.PhoneNumber;
        }
        
        
    }
}